<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/12/21 0021
 * Time: 上午 9:46
 */
$q=$_GET["q"];

$con = mysql_connect('localhost','root','');
if(!$con){
    die('Could not connect:'.mysql_error());
}
mysql_select_db("test",$con);
$sql="select * from users where id='".$q."'";
$result=mysql_query($sql);
echo"<table border='1'>
<tr>
<th>FirstName</th>
<th>LastName</th>
<th>Age</th>
<th>Hometown</th>
<th>Job</th>
</tr>
";
while($row=mysql_fetch_array($result)){
    echo"<tr>";
    echo"<td>".$row['FirstName']."</td>";
    echo"<td>".$row['LastName']."</td>";
    echo"<td>".$row['Age']."</td>";
    echo"<td>".$row['Hometown']."</td>";
    echo"<td>".$row['Job']."</td>";
    echo"</tr>";
}
echo"</table>";
mysql_close($con);